package com.hqyj.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author rock
 * @since 2021-11-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Exam extends MyPage implements Serializable {

    //考试表
    private static final long serialVersionUID=1L;

    @TableId(value = "iexam_id", type = IdType.AUTO)
    private Integer iexamId;


    private String examName;

    /**
     * 考试时间
     */
    private Date examTime;

    private Integer examScore;

    /**
     * 考试转态，0表示结束，1表示正在考，2表示未开始
     */
    private Integer examStatus;

    /**
     * 考试编号
     */
    private Integer examNumber;


    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    public Date getExamTime() {
        return examTime;
    }

    public void setExamTime(String examTime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if(examTime != null){
            try {

                this.examTime = sdf.parse(examTime);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            this.examTime = new Date();
        }

    }


}
